/**
 *  Copyright (c) 2011, IPC Studio, USTC, All rights reserved
 *  FileName: Lrc.h
 *  Author: chengximing1989@gmail.com
 *  DateCreated: 2011-9-28
 *  Brief: class CLrc definition, used to analyze *.lrc, inherit from CLyrics
 */

#ifndef LRC_H_
#define LRC_H_
#include "common.h"
#include "Lyrics.h"
#include "TxtEncoder.h"

LIBLYRICS_NAMESPACE_BEGIN

class CLrc : public CLyrics, TxtEncoder
{
public:
	CLrc(void);
	virtual ~CLrc(void);

protected: //the functions in parent class CLyrics
	bool OpenLyrics(string filename);								//used to open a lyrics file
	string GetLrctxt(int time);										//get the lyrics

protected:
	bool TestLyricsfile(string filename);							//this function used to test whether a *.lrc file is a real lyrics file
	bool LoadLyricsfile(string filename);
	bool ReadTimeLabel(int istart, int iend, string& strMi, string& strSec, string& strmSec);
	void StorelineLyrics(int& istart, int& iend);
};

LIBLYRICS_NAMESPACE_END
#endif